#include "XmlOper.h"

XmlOper::XmlOper(QObject *parent) : QObject(parent)
{

}

void XmlOper::stdXmlOper()
{
    cout << "\nParsing my students data (sample.xml)....." << endl;

    // Read the sample.xml file
    XMLDocument doc;
    doc.LoadFile( "0465-0104-01.xml" );

    if(XMLError::XML_SUCCESS != doc.ErrorID()) {
        std::cout << "load xml not success" << endl;

    }

    XMLElement* titleElement = doc.FirstChildElement( "doc" )->FirstChildElement( "path" );
        const char* title = titleElement->GetText();
        printf( "Name of doc: %s\n", title );

    XMLElement *rootElement = doc.RootElement();
        const char* root = rootElement->GetText();
        printf("root name: %s\n", root);
}
